//
// Created by wze-zero on 2024/9/27 027.
//
#include <iostream>

using namespace std;

int main() {
    string s;
    int count = 0;
    getline(cin,s);
    for (int i = 0; i < s.length(); ++i) {
        if (s.at(i) != ' ' && s.at(i) != '\n') {
            count++;
        }
    }
    cout << count << endl;
    return 0;
}